﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace Futajma.MigrationStudio.LiveLinkImporter.DeploymentReport
{
    class Item
    {
        protected XElement ItemElement { get; private set; }

        public Item(XElement itemElement)
        {
            ItemElement = itemElement;
        }

        public XAttribute GetAttribute(string attributeName)
        {
            return ItemElement.Attribute(attributeName);
        }

        public string GetStringAttribute(string attributeName)
        {
            return (string)GetAttribute(attributeName);
        }

        public string SourceDisplayName { get { return GetStringAttribute("SourceDisplayName"); } }
        public string SourceUrl { get { return GetStringAttribute("SourceUrl"); } }
        public string NewDisplayName { get { return GetStringAttribute("NewDisplayName"); } }
        public string NewUrl { get { return GetStringAttribute("NewUrl"); } }
        public string TargetDisplayName { get { return GetStringAttribute("TargetDisplayName"); } }
        public string TargetUrl { get { return GetStringAttribute("TargetUrl"); } }
        public string Success { get { return GetStringAttribute("Success"); } }
        public string ErrorLevel { get { return GetStringAttribute("ErrorLevel"); } }
        public string Message { get { return GetStringAttribute("Message"); } }



    }
}
